package net.mysoft.budgetsoft.system.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @author dagongPGP v1.0
 * @link <a href=http://www.dagongsoft.net>北京大公信软科技有限公司</a>
 * 
 * @version $Revision: 1.00 $Date: 2013-02-06 11:01:30
 */
//@Entity
//@Table(name = "tbDictionaryType")
public class TDictionaryType implements java.io.Serializable {
	private String typeID;
	private String typeName;
	private String note;
	private Set<TDictionaryDetail> detailSet;

	@Id
	@Column(name = "TypeID", unique = true, nullable = false)
	public String getTypeID() {
		return this.typeID;
	}

	public void setTypeID(String typeID) {
		this.typeID = typeID;
	}

	@Column(name = "TypeName")
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@Column(name = "Note")
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "type")
	public Set<TDictionaryDetail> getDetailSet() {
		return detailSet;
	}

	public void setDetailSet(Set<TDictionaryDetail> detailSet) {
		this.detailSet = detailSet;
	}

	@Override
	public int hashCode() {
		int prime = 0;
		prime += this.getTypeID().hashCode();
		return prime;
	}

	@Override
	public boolean equals(Object obj) {
		boolean isEquals = false;
		if (obj != null && this.getClass() == obj.getClass()) {
			TDictionaryType clazz = (TDictionaryType) obj;
			if (clazz.getTypeID().equals(this.getTypeID()))
				isEquals = true;
			return isEquals;
		}
		return isEquals;
	}

}